package com.ehome.poct.base.api.feign.log;

import com.ehome.core.page.Page;
import com.ehome.poct.base.api.dto.log.TestDeviceSyncLogRecordDTO;
import com.ehome.poct.base.api.qry.ErrorLogQry;
import com.ehome.poct.base.api.qry.LogSyncRecordQry;
import com.ehome.poct.base.api.vo.log.SyncLogRecordListVO;
import com.ehome.poct.base.api.vo.log.TestDeviceErrorLogVO;
import com.ehome.poct.base.api.vo.log.TestDeviceSyncLogRecordVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "${service.poct-base:}${service.suffix.poct-base:}",contextId = "testDeviceLog")
public interface TestDeviceLogFeginClient {

    @GetMapping("/test_device_sync_log_record/log_list")
    SyncLogRecordListVO getLogList(@RequestParam String sno);

    @GetMapping("/test_device_error_log/page")
    Page<TestDeviceErrorLogVO> getErrorLog(@SpringQueryMap ErrorLogQry qry);

    @GetMapping("/test_device_sync_log_record")
    List<TestDeviceSyncLogRecordVO> getLogSyncRecord(@SpringQueryMap LogSyncRecordQry qry);

    @PostMapping("/test_device_sync_log_record")
    TestDeviceSyncLogRecordVO insertSyncLog(@RequestBody TestDeviceSyncLogRecordDTO dto);

    @PutMapping("/test_device_sync_log_record/{id}")
    void updateSyncLog(@PathVariable(value = "id") Long id,@RequestBody TestDeviceSyncLogRecordDTO dto);

    @PostMapping("/test_device_sync_log_record/batch")
    TestDeviceSyncLogRecordVO batchInsertSyncLog(@RequestBody List<TestDeviceSyncLogRecordDTO> list);

    @GetMapping("/test_device_sync_log_record/{id}")
    TestDeviceSyncLogRecordVO getLogSyncRecordById(@PathVariable(value = "id") Long id);
}
